# 作者：SP
# 开发时间：2025/3/30 13:59
#QDate、QDatetime

from PyQt5.QtCore import QDate,QDateTime,QTime,Qt

if __name__ == '__main__':
    '''返回当前的日期'''
    now = QDate.currentDate()
    print(now)
    print(now.toString())
    print(now.toString(Qt.ISODate))
    print(now.toString(Qt.DefaultLocaleLongDate))
    print('--------------------------------------')
    '''返回当前日期和时间'''
    datetime = QDateTime.currentDateTime()
    print(datetime)
    print(datetime.toString())
    print(datetime.toString(Qt.ISODate))
    print(datetime.toString(Qt.DefaultLocaleLongDate))
    print(datetime.toString('yyyy/mm/dd HH:mm:ss'))
    print('--------------------------------------')
    '''返回当前的时间'''
    time = QTime.currentTime()
    print(time)
    print(time.toString())
    print(time.toString(Qt.ISODate))
    print(time.toString(Qt.DefaultLocaleLongDate))